<?php

class Model_StaruserReport extends Model {

    function __construct() {
        
    }

    function getList() {
        $result = array();
        $param = array();
        $param['field'] = "report";
        $param['where'] = "status=1";
        $param['order'] = " sequence asc";
        $param['group'] = "";
        $param['limit'] = 4;
        $param['pagesize'] = 4;
        $param['page'] = 1;
        $param['join'] = "";
        $param['on'] = "";
        $data = db_query_hash('hilite_staruser_report', $param);


        if ($data['result']) {
            
                foreach ($data['result'] as $value) {
                    
                    $where = " TB1.is_blog=0  and TB1.id=".$value['report'];
                    
                    $param = array();
                    $param['field'] = "TB1.id,TB1.oid,TB1.mid,TB1.title,TB1.agegroup,TB1.content_json,TB1.body,(TB1.likes+TB1.likes_num_base) AS likes,TB1.well,TB1.category_score1,TB1.category_score2,TB1.category_score3,TB1.category_score4,TB1.category_score5,TB1.category_score6,TB1.category_score7,TB1.category_score8,TB1.is_valid,TB1.discuz_pid,TB1.is_accept,TB1.grade,TB1.reject_reason,TB1.sequence,TB1.priority,TB1.status,TB1.addtime,TB1.comments,TB1.body_skin,TB1.fb_share_num_base,TB1.is_publish,TB2.photo,TB2.username,TB1.is_blog,TB2.member_type";
                    $param['where'] = $where;
                    $param['order'] = ""; //"id asc"
                    $param['group'] = "";
                    $param['limit'] = "";
                    $param['pagesize'] = "";
                    $param['page'] = "";
                    $param['join'] = "LEFT JOIN member_imore";
                    $param['on'] = "TB1.mid = TB2.id";
                    $data_reports = db_query_hash('product_reports', $param);
                    if ($data_reports['result']) {
                       
                        $result[$value['report']] = $data_reports['result'][0];
                    }
                }
            
        }
        
        return $result;
    }

}

?>